import { ApiProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';
/* 
  当参数验证不通过 validator时，会自动报400错误
*/
export class CreatePostDto {
  @ApiProperty({ description: '帖子标题', example: '好消息消息' })
  @IsString()
  readonly title: string;

  @ApiProperty({ description: '帖子内容', example: '帖子内容' })
  @IsString()
  readonly content: string;

  @ApiProperty({ description: '帖子作者', example: '莫言' })
  @IsString()
  readonly author: string;
}
